<?php $this->fetch('public/head') ?>

<div class="layui-tab layui-tab-brief">
    <ul class="layui-tab-title">
        <li class=""><a href="<?php echo url('index') ?>">负责人列表</a></li>
        <li class="layui-this">编辑负责人</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <form class="layui-form form-container" action="<?php echo url('edit') ?>" method="post">
                <div class="layui-form-item">
                    <label class="layui-form-label">姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value="<?php echo $rows['name'] ?>" required  lay-verify="required" placeholder="请输入标题" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">电话</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone" value="<?php echo $rows['phone'] ?>" required  lay-verify="required" placeholder="请输入标题" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">区域选择</label>
                    <div class="layui-input-inline city">
                        <select class="province" id="province" lay-filter="province">
                            <option value= 0 >上海</option>
                            <option value= 1 >北京</option>
                            <option value= 2 >天津</option>
                            <option value= 3 >重庆</option>
                            <option value= 4 >河北</option>
                            <option value= 5 >山西</option>
                            <option value= 6 >内蒙古</option>
                            <option value= 7 >辽宁</option>
                            <option value= 8 >吉林</option>
                            <option value= 9 >黑龙江</option>
                            <option value= 10 >江苏</option>
                            <option value= 11 >浙江</option>
                            <option value= 12 >安徽</option>
                            <option value= 13 >福建</option>
                            <option value= 14 >江西</option>
                            <option value= 15 >山东</option>
                            <option value= 16 >河南</option>
                            <option value= 17 >湖北</option>
                            <option value= 18 >湖南</option>
                            <option value= 19 >广东</option>
                            <option value= 20 >广西</option>
                            <option value= 21 >海南</option>
                            <option value= 22 >四川</option>
                            <option value= 23 >贵州</option>
                            <option value= 24 >云南</option>
                            <option value= 25 >西藏</option>
                            <option value= 26 >陕西</option>
                            <option value= 27 >甘肃</option>
                            <option value= 28 >宁夏</option>
                            <option value= 29 >青海</option>
                            <option value= 30 >新疆</option>
                            <option value= 31 >香港</option>
                            <option value= 32 >澳门</option>
                            <option value= 33 >台湾</option>
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <select  lay-ignore multiple="multiple" style="width:100px" name="city" id="city" class="city">
                        </select>
						
                    </div>
                    <button type="button" onclick="jia(this)"  class="layui-btn" lay-filter="jia"><i class="layui-icon">&#xe67c;</i>添加</button>
						如需要选择多个城市,请配合CTRL键多选
				</div>

                <div class="layui-form-item">
                    <label class="layui-form-label">内容</label>
                    <div class="layui-input-block">
                        <textarea name="content" id="content" class="layui-textarea" style="weight: 100px;"><?php echo $rows['area'] ?></textarea>
                    </div>

                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="启用" <?php if($rows['status']==1){ ?>checked="checked" <?php } ?>>
                        <input type="radio" name="status" value="0" title="停用" <?php if($rows['status']==0){ ?>checked="checked" <?php } ?>>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">商城负责人</label>
                    <div class="layui-input-block">
                        <input type="radio" name="shangcheng" value="1" title="是" <?php if($rows['shangcheng']==1){ ?>checked="checked" <?php } ?>>
                        <input type="radio" name="shangcheng" value="0" title="否" <?php if($rows['shangcheng']==0){ ?>checked="checked" <?php } ?>>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">预约负责人</label>
                    <div class="layui-input-block">
                        <input type="radio" name="yuyue" value="1" title="是" <?php if($rows['yuyue']==1){ ?>checked="checked" <?php } ?>>
                        <input type="radio" name="yuyue" value="0" title="否" <?php if($rows['yuyue']==0){ ?>checked="checked" <?php } ?>>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">默认负责人</label>
                    <div class="layui-input-block">
                        <input type="radio" name="def" value="1" title="是" <?php if($rows['def']==1){ ?>checked="checked" <?php } ?>>
                        <input type="radio" name="def" value="0" title="否" <?php if($rows['def']==0){ ?>checked="checked" <?php } ?>>
                        未设置负责人员的区域，由默认负责人处理
                    </div>

                </div>
                <input type="hidden" name="id" value="<?php echo $rows['id'] ?>">
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit lay-filter="*">保存</button>
                        <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script src="_js/ss.js"></script>
<?php $this->fetch('public/script') ?>

<script>
    form.on('select(province)', function (data) {
        getCity();
        form.render();
    })
    function add() {
        alert(123);
    }

</script>
<script type="text/javascript">
    //form.on('button()')

    function jia(obj){
        //alert(123);
        var province=$('#province option:selected').text()
        var city=$("select[name=city]").val()
        var str="";
        $.each(city,function (k,v) {
            str += "|"+province+v;
        })
        content.innerHTML += str;
    }
</script>
